package com.qxzl.util;

import com.qxzl.model.Clients;
import com.qxzl.model.Services;

import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author Created by 陈彭伟.
 * @Email hccpw@sina.com
 * @Date 2018/3/22 12:03
 */
@Component
public class FindBeanByIp {

    public Clients getClientById(String ip){
        for (Clients client : StaticData.clients) {
            if (ip.equals(client.getIp())) {
                return client;
            }
        }
        return null;
    }

    public Services getServiceById(String ip){
        for (Services service : StaticData.services) {
            if (ip.equals(service.getIp())) {
                return service;
            }
        }
        return null;
    }
}
